﻿<%@ Page Title="" Language="C#" MasterPageFile="~/WebAdmin/MasterPage_WebAdmin.master" AutoEventWireup="true" CodeBehind="CatListCatPage.aspx.cs" Inherits="Ones.WebAdmin.CatListCatPage" %>

<%@ Register TagPrefix="uc" TagName="Pager" Src="~/Utils/UserControls/Pager.ascx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" runat="server"> </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphMain" runat="server">
    <div class="row">
        <div class="col-lg-12">
            <div class="widget">
                <div class="widget-header">
                    <i class="icon-table"></i>
                    <h3>
                        Categories
                    </h3>
                    <div class="dataTables_filter" id="example_filter">
                        <asp:DropDownList runat="server" class="form-control required" Style="width: 160px; display: inline;" ID="ddlSearchBy">
                            <asp:ListItem Value="name" Text="Search by Name"></asp:ListItem>
                            <asp:ListItem Value="id" Text="Search by ID"></asp:ListItem>
                        </asp:DropDownList>
                        <asp:TextBox runat="server" ID="txtSearch" style="height: 40px; margin-top: 10px; margin-right: 7px;" aria-controls="example"></asp:TextBox>
                        <asp:Button runat="server" Text="Search" ID="btnSearch" class="btn btn-sm btn-default" style="margin-right: 10px;" onclick="btnSearch_Click"/>
                    </div>
                </div>
                <div class="widget-content">
                    <div class="example_alt_pagination">
                        <div class="full_width big"> </div>
                        <div id="container">
                            <div id="demo">
                                <!--------- CONTENT TABLE ------------->
                                <table class="table table-striped table-images">
                                    <thead>
                                        <tr>
                                            <th>
                                                Name
                                            </th>
                                            <th>
                                                Description
                                            </th>
                                            <th>
                                                Parent
                                            </th>
                                            <th>
                                                Division
                                            </th>
                                            <th>
                                                &nbsp;
                                            </th>
                                            <th>
                                                &nbsp;
                                            </th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <asp:Repeater ID="catList" runat="server" onitemcommand="catList_ItemCommand">
                                            <ItemTemplate>
                                                <!--<tr class='#Container.ItemIndex % 2 == 0 ? "gradeA odd" : "gradeA even" %>'>-->
                                                <tr>
                                                    <td>
                                                    <%#Eval("catName")%>
                                                    </td>
                                                    <td>
                                                    <%#Eval("catDescription")%>
                                                    </td>
                                                    <td>
                                                    <%#Eval("catParentId")%>
                                                    </td>
                                                    <td>
                                                    <%#Eval("belongToDivision")%>
                                                    </td>
                                                    <td>
                                                        <asp:Button runat="server" CssClass="icon-edit btn btn-warning" Text="Edit" CommandName="edit" CommandArgument='<%#Eval("catId") %>' UseSubmitBehavior="false"/>
                                                    </td>
                                                    <td>
                                                        <asp:Button runat="server" CssClass="icon-remove btn btn-danger" Text="Delete" CommandName="delete" CommandArgument='<%#Eval("catId") %>' UseSubmitBehavior="false"/>
                                                    </td>
                                                </tr>
                                            </ItemTemplate>
                                        </asp:Repeater>
                                    </tbody>
                                </table>                                
                                <div class="clearfix">
                                    <uc:Pager ID="pager" runat="server" Url="CatListCatPage.aspx" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphScript" runat="server"> </asp:Content>
